import java.util.*;
public class ArraySort
{
    public static void main(String[] args)
    {
        int [] a = new int[]{8,5,4,1,2,7,3,6,9};

        for(var i : a)
            System.out.print(i+" ");
        System.out.println();

        Arrays.sort(a);

        for(var i : a)
            System.out.print(i+" ");
        System.out.println();
    }
}
